home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20020314-20021006
/
000329_arthur.marsh@adelaide.edu.au_Fri Aug 30 09:05:35 EDT 2002.msg
< prev
next >
Wrap
Text File
|
2002-10-06
|
3KB
|
94 lines
Article: 13659 of comp.protocols.kermit.misc
Path: newsmaster.cc.columbia.edu!panix!news-out.cwix.com!newsfeed.cwix.com!news1.optus.net.au!optus!news.optus.net.au!53ab2750!not-for-mail
From: Arthur Marsh <arthur.marsh@adelaide.edu.au>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.protocols.kermit.misc
Subject: Re: scripting capturing of Cisco ARP tables
References: <3d6e39ea@yorrell.saard.net> <aklgqn$2gv$1@watsol.cc.columbia.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: arthur-4100.its.adelaide.edu.au
Message-ID: <3d6ed522$1@yorrell.saard.net>
X-Original-Trace: 30 Aug 2002 11:44:58 +0950, arthur-4100.its.adelaide.edu.au
Lines: 72
Date: Fri, 30 Aug 2002 02:15:01 GMT
NNTP-Posting-Host: 203.21.37.20
X-Trace: news.optus.net.au 1030673701 203.21.37.20 (Fri, 30 Aug 2002 12:15:01 EST)
NNTP-Posting-Date: Fri, 30 Aug 2002 12:15:01 EST
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:13659
Thanks, my rough, first working script is (with username, password and
ip addresses changed):
#!/usr/local/bin/kermit
; open log file
fopen /write \%c arp.log
if fail exit
; declare router addresses
dcl \&a[] = 129.127.134.254 129.127.135.125
for \%i 1 \fdim(&a) 1 {
close connection
set telnet wait off
set host \&a[\%i]
if fail break
minput 10 "Username:"
if fail break
lineout myname
minput 10 "Password:"
if fail break
lineout mypassword
if equal \&a[\%i] 129.127.135.125 {
minput 10 "#" ">" ")"
if fail break
clear input
lineout session 15
minput 10 "router"
if fail break
}
else {
minput 10 "#" ">" ")"
if fail break
}
lineout show arp ; Send "show arp" and CR
set flag on ; Loop control
while flag { ; Loop
clear input ; Clear INPUT buffer
minput 10 "\10" "--More--" ">" "#" ; Wait for trigger strings
if fail break
switch \v(minput) {
:1, if equal "\fleft(\v(input),8)" "Internet" {
fwrite \%c \v(input)
}
break
:2, output " "
break
:3, set flag off
}
}
}
close connection
echo
echo finished C-Kermit
exit
A shell script then sorts and cleans the output and a Perl script
compares the data it with what was in an Oracle database, updating a
"lastarp_date" column of a table containing MAC addreeses of devices in
our network.
--
Arthur Marsh, Network Support Officer, Information Technology Services
The University of Adelaide SA 5005 Australia
Ph: +61 8 8303 6109, Mobile: +61 414 260 077